﻿@model enqueteJwVd.UserSurvey
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Link users to Survey</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@if (ViewBag.YouSelected != null)
{ 
    <div>
        You Selected: @ViewBag.YouSelected</div> 
}
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>UserSurvey</legend>
        <table>
            <tr>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.UserFkId, "UsersList")
                    </div>
                </td>
                <td>
                    <div class="editor-field">
                        @Html.ListBox("UsersList", ViewBag.UsersList as MultiSelectList)
                        @Html.ValidationMessageFor(model => model.UserFkId)
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label">
                        @Html.LabelFor(model => model.SurveyFkId, "Survey")
                    </div>
                </td>
                <td>
                    <div class="editor-field">
                        @Html.DropDownList("SurveyFkId", String.Empty)
                        @Html.ValidationMessageFor(model => model.SurveyFkId)
                    </div>
                </td>
            </tr>
        </table>
        <p>
            <input type="submit" value="Link Users" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
